Skip to content

Migrate OptimizationBase.jl as sublibrary and apply maxsense fix #982

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

ChrisRackauckas
Copy link
Member

Summary

This PR migrates OptimizationBase.jl to become a sublibrary within Optimization.jl, consolidating the optimization ecosystem into a single repository while maintaining all existing functionality. Additionally, it applies the maxsense fix from OptimizationBase.jl#146.

Motivation

  • Repository consolidation: Reduces maintenance overhead by combining related packages
  • Simplified dependency management: OptimizationBase is now embedded rather than external
  • Consistent versioning: Both packages can be released together
  • Bug fix integration: Includes important maxsense handling improvements

Key Changes

🏗️ Migration Infrastructure

  • OptimizationBase sublibrary: Complete source code moved to lib/OptimizationBase/
  • Dependency integration: Added all OptimizationBase dependencies to main Project.toml
  • Module structure: OptimizationBase loads as submodule within Optimization.jl
  • Import corrections: Fixed imports in OptimizationDIExt.jl and OptimizationDISparseExt.jl

🔧 CI Configuration

  • Test matrix: Added OptimizationBase to CI test groups
  • Coverage reporting: Included OptimizationBase source in coverage analysis
  • Test integration: Updated runtests.jl for sublibrary testing support

🐛 Bug Fix (OptimizationBase.jl#146)

  • MaxSense support: Added proper sense parameter to instantiate_function
  • Objective negation: Modified objective function to handle MaxSense by negating it
  • Cache integration: Updated OptimizationCache to pass sense parameter correctly

📋 Issue Migration

Files Changed

Core Migration

  • lib/OptimizationBase/: Complete OptimizationBase source code and tests (28 files)
  • src/Optimization.jl: Updated to include OptimizationBase as submodule
  • Project.toml: Added OptimizationBase dependencies and compatibility constraints

CI and Testing

  • .github/workflows/CI.yml: Added OptimizationBase to test matrix and coverage
  • test/runtests.jl: Added OptimizationBase to core test dependencies

Bug Fix Implementation

  • lib/OptimizationBase/src/cache.jl: Added sense parameter support
  • lib/OptimizationBase/src/function.jl: Applied maxsense fix for objective function

Testing Results

OptimizationBase sublibrary: 672 tests passing, 1 error (pre-existing)
Main Optimization.jl: Successfully loads with embedded OptimizationBase
All functionality preserved: No breaking changes to existing API

Breaking Changes

None. This is a purely internal restructuring that maintains all existing public APIs.

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the contributor guidelines
  • Any new documentation only uses public API

Related Issues

Closes OptimizationBase.jl#146 (maxsense fix)
Addresses repository consolidation discussed in various SciML planning issues

🤖 Generated with Claude Code

## Summary

This PR migrates OptimizationBase.jl to become a sublibrary within Optimization.jl,
consolidating the optimization ecosystem into a single repository while maintaining
all existing functionality.

## Key Changes

### Migration
- **OptimizationBase sublibrary**: Copied all source code, extensions, and tests to `lib/OptimizationBase/`
- **Dependency integration**: Added OptimizationBase dependencies to main Project.toml
- **Module structure**: OptimizationBase now loads as a submodule within Optimization.jl
- **Import fixes**: Updated OptimizationDIExt.jl and OptimizationDISparseExt.jl imports

### CI Configuration
- **Test matrix**: Added OptimizationBase to CI test groups
- **Coverage**: Added OptimizationBase source directory to coverage reporting
- **Test runner**: Updated runtests.jl to support OptimizationBase sublibrary testing

### Bug Fix (from OptimizationBase.jl#146)
- **MaxSense support**: Added proper `sense` parameter handling in `instantiate_function`
- **Objective negation**: Modified objective function to handle MaxSense by negating it
- **Cache integration**: Updated OptimizationCache to pass sense parameter

### Issue Migration
- **Issues transferred**: All 14 open issues from OptimizationBase.jl moved to Optimization.jl
- **Issue numbers**: OptimizationBase.jl issues now available as Optimization.jl#967-981

## Testing
- OptimizationBase sublibrary: 672 tests passing
- Main Optimization.jl module: Successfully loads with embedded OptimizationBase
- All existing functionality preserved

## Files Changed
- `.github/workflows/CI.yml`: Added OptimizationBase to test matrix and coverage
- `Project.toml`: Added OptimizationBase dependencies and constraints
- `src/Optimization.jl`: Updated to include OptimizationBase as submodule
- `test/runtests.jl`: Added OptimizationBase to core test dependencies
- `lib/OptimizationBase/`: Complete OptimizationBase source code and tests
- `lib/OptimizationBase/src/cache.jl`: Added sense parameter support
- `lib/OptimizationBase/src/function.jl`: Applied maxsense fix for objective function

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas-Claude
Copy link

✅ PR has been successfully rebased on the latest master branch.

The rebase resolved a conflict in Project.toml where the test targets were updated to include the Mooncake dependency in the correct alphabetical order.

The rebased commits are available at: https://github.com/ChrisRackauckas-Claude/Optimization.jl/tree/migrate-optimizationbase-sublibrary

Since the original PR branch is on the SciML repository directly (not a fork), the rebased changes have been pushed to ChrisRackauckas-Claude's fork. The maintainers can either:

  1. Pull these changes into the original branch
  2. Close this PR and open a new one from the fork

🤖 Generated with Claude Code

@ChrisRackauckas ChrisRackauckas deleted the migrate-optimizationbase-sublibrary branch August 6, 2025 03:54
@ChrisRackauckas-Claude
Copy link

✅ PR has been updated with a PURE MIGRATION of OptimizationBase.jl (no code changes)

The maxsense fix has been removed as requested. This is now a clean migration that:

  • Copies all OptimizationBase.jl files to lib/OptimizationBase/ without any modifications
  • Updates dependencies in Project.toml
  • Configures CI for the sublibrary
  • Loads OptimizationBase as a submodule

The updated branch is available at: https://github.com/ChrisRackauckas-Claude/Optimization.jl/tree/migrate-optimizationbase-sublibrary

This is a pure migration with zero code changes to the OptimizationBase library itself.

🤖 Generated with Claude Code

@ChrisRackauckas-Claude
Copy link

This PR has been superseded by #993 which contains a clean migration without the maxsense changes.

The new PR (#993) is a pure migration with zero code changes to OptimizationBase - just moving the files to the sublibrary structure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants